package service.app.impl;

import java.util.List;

import model.app.AppInfo;

import dao.app.AppInfoDAO;
import exception.Exceptions;
import service.app.InfoService;

public class InfoServiceImpl implements InfoService {
	private AppInfoDAO appInfoDAO;

	@Override
	public String getInfo(String name) {
		return appInfoDAO.findOne("name",name).getValue();
	}
	public List<AppInfo> getInfoList(){
		return appInfoDAO.findAll();
	}
	public AppInfo getOne(Integer id) throws Exceptions{
		AppInfo info=appInfoDAO.findOne("id", id);
		if(info==null) throw new Exceptions("获取公司基本信息异常，数据库没有此信息记录！");
		return info;
	}
	public void save_in_AppInfo(AppInfo info){
		appInfoDAO.saveOrUpdate(info);
	}

	public AppInfoDAO getAppInfoDAO() {
		return appInfoDAO;
	}

	public void setAppInfoDAO(AppInfoDAO appInfoDAO) {
		this.appInfoDAO = appInfoDAO;
	}

}
